﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

using Finance.UI.ViewModels;
using Finance.Entites;

namespace Finance.UI
{
    public partial class BudgetPage : PhoneApplicationPage
    {
        public BudgetPage()
        {
            InitializeComponent();
            this.Loaded += (o, e) =>
            {
                InitializeContext();
            };
        }

        private void InitializeContext()
        {
            var classificationGroups = new ObservableCollection<string>();
            foreach (var group in App.PayoutClassificationDataStore.Items.Select(c => c.Group).Distinct())
            {
                classificationGroups.Add(group);
            };

            this.DataContext = new BudgetPageViewModel()
            {
                Items = classificationGroups
            };
        }

        private void MenuItemEdit_Click(object sender, RoutedEventArgs e)
        {

        }
        private void MenuItemDelete_Click(object sender, RoutedEventArgs e)
        {

        }
    }
}